package Six;

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Six {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		Queue<String> q1 = new LinkedList<String>();
		Queue<String> q2 = new LinkedList<String>();
		Queue<String> q = new LinkedList<String>();
		int n = scan.nextInt();
		for (int i = 0; i < n; i++) {
			int x = scan.nextInt();
			if (x % 2 != 0) {
				q1.offer(x + "");
			} else {
				q2.offer(x + "");
			}
		}
		for (int i = 0; i < n; i++) {
			while (!q1.isEmpty()) {
				q.offer(q1.peek());
				q1.poll();
				while (!q1.isEmpty()) {
					q.offer(q1.peek());
					q1.poll();
					break;
				}
				break;
			}
			while (!q2.isEmpty()) {
				q.offer(q2.peek());
				q2.poll();
				break;
			}
		}
		int a = q.size() - 1;
		for (int i = 0; i < a; i++) {
			System.out.print(q.peek() + " ");
			q.poll();
		}
		System.out.println(q.peek());
		scan.close();
	}
}
